package com.itheima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.itheima.pojo.Member;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author jshstart
 * @creat 2020-11-15 13:06
 */
public interface MemberMapper extends BaseMapper<Member> {
    @Select("select count(*) from t_member m\n" +
            "left join rpt_date rd  on rd.id= m.create_date_id\n" +
            "where rd.fdate=#{formatDate}")
    int findTodayNewMember(@Param("formatDate") String formatDate);


    @Select( "select count(*) from t_member m\n" +
            "left join  rpt_date  rd on rd.id= m.create_date_id\n" +
            "where  rd.fweek=#{thisweek}")
    int findThisWeekNewMember(@Param("thisweek") int thisweek);

    @Select("select count(*) from t_member m\n" +
            "left join  rpt_date  rd on rd.id= m.create_date_id\n" +
            "where  rd.fmonth=#{thismonth}")
    int findThisMonthNewMember(@Param("thismonth") String thismonth);
}
